From 0a4522458b80b1d21f4f749dd1512cc75df85769 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 4 Mar 2006 10:25:05 +0100 Subject: [PATCH] Fix some warnings when compiling tools. Signed-off-by: Xin Li --- tools/firmware/vmxassist/setup.c | 5 +++-- tools/ioemu/audio/audio.c | 2 +- tools/ioemu/hw/i8254.c | 2 +- tools/ioemu/monitor.c | 8 ++++---- tools/ioemu/target-i386-dm/helper2.c | 16 +++++----------- tools/ioemu/vl.c | 4 ++-- xen/include/public/hvm/ioreq.h | 4 ++-- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/tools/firmware/vmxassist/setup.c b/tools/firmware/vmxassist/setup.c index 25e5abd146..fcaf676e44 100644 --- a/tools/firmware/vmxassist/setup.c +++ b/tools/firmware/vmxassist/setup.c @@ -123,6 +123,8 @@ setup_paging(void) void setup_gdt(void) { + unsigned long long addr = (unsigned long long) &tss; + /* setup task state segment */ memset(&tss, 0, sizeof(tss)); tss.ss0 = DATA_SELECTOR; @@ -130,8 +132,7 @@ setup_gdt(void) tss.iomap_base = offsetof(struct tss, iomap); /* initialize gdt's tss selector */ - unsigned long long addr = (unsigned long long) &tss; - gdt[TSS_SELECTOR / sizeof(gdt[0])] |= + gdt[TSS_SELECTOR / sizeof(gdt[0])] |= ((addr & 0xFF000000) << (56-24)) | ((addr & 0x00FF0000) << (32-16)) | ((addr & 0x0000FFFF) << (16)) | diff --git a/tools/ioemu/audio/audio.c b/tools/ioemu/audio/audio.c index c3782d58a2..d866cde03b 100644 --- a/tools/ioemu/audio/audio.c +++ b/tools/ioemu/audio/audio.c @@ -713,7 +713,7 @@ int AUD_calc_elapsed (SWVoice *sw) delta = now - sw->old_ticks; bytes = (delta * sw->bytes_per_second) / ticks_per_sec; if (delta < 0) { - dolog ("whoops delta(<0)=%lld\n", delta); + dolog ("whoops delta(<0)=%"PRId64"\n", delta); return 0; } diff --git a/tools/ioemu/hw/i8254.c b/tools/ioemu/hw/i8254.c index 1d98bd72a5..7c5e622c4d 100644 --- a/tools/ioemu/hw/i8254.c +++ b/tools/ioemu/hw/i8254.c @@ -249,7 +249,7 @@ void pit_reset_hvm_vectors() req->u.data |= (irq << 16); req->u.data |= (hvm_channel << 24); req->u.data |= ((s->rw_mode) << 26); - fprintf(logfile, "HVM_PIT:pass info 0x%llx to HV!\n", req->u.data); + fprintf(logfile, "HVM_PIT:pass info 0x%"PRIx64" to HV!\n", req->u.data); } static inline void pit_load_count(PITChannelState *s, int val) diff --git a/tools/ioemu/monitor.c b/tools/ioemu/monitor.c index 3280dc0169..f4c06fbf14 100644 --- a/tools/ioemu/monitor.c +++ b/tools/ioemu/monitor.c @@ -676,19 +676,19 @@ static void monitor_handle_command(const char *cmdline) break; case '-': { - int has_option; + long has_option; /* option */ - + c = *typestr++; if (c == '\0') goto bad_type; - while (isspace(*p)) + while (isspace(*p)) p++; has_option = 0; if (*p == '-') { p++; if (*p != c) { - term_printf("%s: unsupported option -%c\n", + term_printf("%s: unsupported option -%c\n", cmdname, *p); goto fail; } diff --git a/tools/ioemu/target-i386-dm/helper2.c b/tools/ioemu/target-i386-dm/helper2.c index bc6bc0a12f..14341f3d18 100644 --- a/tools/ioemu/target-i386-dm/helper2.c +++ b/tools/ioemu/target-i386-dm/helper2.c @@ -138,11 +138,11 @@ void sp_info() req = &(shared_page->vcpu_iodata[i].vp_ioreq); term_printf("vcpu %d: event port %d\n", i, shared_page->vcpu_iodata[i].vp_eport); - term_printf(" req state: %x, pvalid: %x, addr: %llx, " - "data: %llx, count: %llx, size: %llx\n", + term_printf(" req state: %x, pvalid: %x, addr: %"PRIx64", " + "data: %"PRIx64", count: %"PRIx64", size: %"PRIx64"\n", req->state, req->pdata_valid, req->addr, req->u.data, req->count, req->size); - term_printf(" IO totally occurred on this vcpu: %llx\n", + term_printf(" IO totally occurred on this vcpu: %"PRIx64"\n", req->io_count); } } @@ -158,8 +158,8 @@ static ioreq_t* __cpu_get_ioreq(int vcpu) return req; fprintf(logfile, "False I/O request ... in-service already: " - "%x, pvalid: %x, port: %llx, " - "data: %llx, count: %llx, size: %llx\n", + "%x, pvalid: %x, port: %"PRIx64", " + "data: %"PRIx64", count: %"PRIx64", size: %"PRIx64"\n", req->state, req->pdata_valid, req->addr, req->u.data, req->count, req->size); return NULL; @@ -460,12 +460,6 @@ int main_loop(void) FD_ZERO(&wakeup_rfds); FD_SET(evtchn_fd, &wakeup_rfds); -#if __WORDSIZE == 32 -#define ULONGLONG_MAX 0xffffffffffffffffULL -#else -#define ULONGLONG_MAX ULONG_MAX -#endif - tun_receive_handler(&rfds); if ( FD_ISSET(evtchn_fd, &rfds) ) { cpu_handle_ioreq(env); diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index c8794f132d..d7d75dacb0 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -2672,6 +2672,7 @@ int main(int argc, char **argv) char qemu_dm_logfilename[64]; const char *loadvm = NULL; unsigned long nr_pages, extra_pages, ram_pages, *page_array; + xc_dominfo_t info; extern void *shared_page; extern void *shared_vram; @@ -3132,7 +3133,7 @@ int main(int argc, char **argv) ram_pages = ram_size/PAGE_SIZE; #if defined(__i386__) || defined(__x86_64__) - vgaram_pages = (vga_ram_size -1)/PAGE_SIZE + 1; + vgaram_pages = (vga_ram_size -1) / PAGE_SIZE + 1; free_pages = vgaram_pages / L1_PAGETABLE_ENTRIES; extra_pages = vgaram_pages + free_pages; #else @@ -3142,7 +3143,6 @@ int main(int argc, char **argv) xc_handle = xc_interface_open(); - xc_dominfo_t info; xc_domain_getinfo(xc_handle, domid, 1, &info); nr_pages = info.nr_pages + extra_pages; diff --git a/xen/include/public/hvm/ioreq.h b/xen/include/public/hvm/ioreq.h index c93f908dd6..4897ba3b14 100644 --- a/xen/include/public/hvm/ioreq.h +++ b/xen/include/public/hvm/ioreq.h @@ -71,8 +71,8 @@ typedef struct { typedef struct { ioreq_t vp_ioreq; /* Event channel port */ - unsigned long vp_eport; /* VMX vcpu uses this to notify DM */ - unsigned long dm_eport; /* DM uses this to notify VMX vcpu */ + unsigned int vp_eport; /* VMX vcpu uses this to notify DM */ + unsigned int dm_eport; /* DM uses this to notify VMX vcpu */ } vcpu_iodata_t; typedef struct { -- 2.30.2